package com.hlab.fabrevealmenu.helper;

/**
 * Direction
 *
 * @since 2021-05-14
 */
public enum Direction {
    /**
     * LEFT UP RIGHT DOWN
     */
    LEFT(0), UP(1), RIGHT(2), DOWN(3);
    private int id;

    Direction(int id) {
        this.id = id;
    }

    /**
     * fromId
     *
     * @param id id
     * @return Direction
     */
    public static Direction fromId(int id) {
        for (Direction direction : values()) {
            if (direction.id == id) {
                return direction;
            }
        }
        return LEFT;
    }
}
